|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.app.AbstractApplication
org.jhotdraw.app.DefaultSDIApplication
public class DefaultSDIApplication
DefaultSDIApplication handles the lifecycle of a Views
using a single document interface (SDI).
An application consists of independent JFrames for each view.
Each JFrame contains a menu bar, toolbars and palette bars for
the views.
The life cycle of the application is tied to the JFrames. Closing the
last JFrame quits the application.
DefaultSDIApplication handles the life cycle of a single document window
being presented in a JFrame. The JFrame provides all the functionality needed
to work with the document, such as a menu bar, tool bars and palette windows.
The life cycle of the application is tied to the JFrame. Closing the JFrame quits the application.
| Nested Class Summary | |
|---|---|
private class |
DefaultSDIApplication.OpenRecentMenuHandler
Updates the menu items in the "Open Recent" file menu. |
| Field Summary | |
|---|---|
private java.util.prefs.Preferences |
prefs
|
| Fields inherited from class org.jhotdraw.app.AbstractApplication |
|---|
labels, VIEW_COUNT_PROPERTY |
| Fields inherited from class org.jhotdraw.beans.AbstractBean |
|---|
propertySupport |
| Fields inherited from interface org.jhotdraw.app.Application |
|---|
ACTIVE_VIEW_PROPERTY |
| Constructor Summary | |
|---|---|
DefaultSDIApplication()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
configure(java.lang.String[] args)
Configures the application using the provided arguments array. |
protected javax.swing.JMenu |
createEditMenu()
|
protected javax.swing.JMenu |
createFileMenu(View p)
|
protected javax.swing.JMenu |
createHelpMenu(View p)
|
protected javax.swing.JMenuBar |
createMenuBar(View p,
java.util.List<javax.swing.Action> toolBarActions)
The view menu bar is displayed for a view. |
protected javax.swing.JMenu |
createViewMenu(View p,
java.util.List<javax.swing.Action> viewActions)
Creates the view menu. |
void |
dispose(View p)
This is a convenience method for removing a view and disposing it. |
java.awt.Component |
getComponent()
Returns the application component. |
void |
hide(View p)
Hides a view. |
void |
init()
Initializes the application. |
protected void |
initApplicationActions()
|
protected void |
initLookAndFeel()
|
protected void |
initViewActions(View p)
|
boolean |
isSharingToolsAmongViews()
Returns true, if this application shares tools among multiple views. |
void |
launch(java.lang.String[] args)
Launches the application from the main method. |
void |
remove(View p)
Removes a view from this application and removes it from the users view. |
void |
show(View p)
Shows a view. |
protected void |
updateViewTitle(View p,
javax.swing.JFrame f)
Updates the title of a view and displays it in the given frame. |
protected java.awt.Component |
wrapViewComponent(View p)
Returns the view component. |
| Methods inherited from class org.jhotdraw.app.AbstractApplication |
|---|
add, addPalette, addRecentFile, addWindow, basicCreateView, clearRecentFiles, createContainer, createView, getActiveView, getCopyright, getModel, getName, getVersion, initLabels, isEnabled, recentFiles, removePalette, removeWindow, setActiveView, setEnabled, setModel, start, stop, views |
| Methods inherited from class org.jhotdraw.beans.AbstractBean |
|---|
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jhotdraw.app.Application |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
private java.util.prefs.Preferences prefs
| Constructor Detail |
|---|
public DefaultSDIApplication()
| Method Detail |
|---|
public void launch(java.lang.String[] args)
Application
launch in interface Applicationlaunch in class AbstractApplicationpublic void init()
Applicationconfigure() should have been invoked before the application
is inited. Alternatively an application can be configured using setter
methods.
init in interface Applicationinit in class AbstractApplicationpublic void remove(View p)
Application
remove in interface Applicationremove in class AbstractApplicationpublic void configure(java.lang.String[] args)
Application
configure in interface Applicationconfigure in class AbstractApplicationprotected void initLookAndFeel()
protected void initApplicationActions()
protected void initViewActions(View p)
initViewActions in class AbstractApplicationpublic void show(View p)
Application
protected java.awt.Component wrapViewComponent(View p)
public void hide(View p)
Application
public void dispose(View p)
Application
dispose in interface Applicationdispose in class AbstractApplication
protected javax.swing.JMenuBar createMenuBar(View p,
java.util.List<javax.swing.Action> toolBarActions)
protected javax.swing.JMenu createFileMenu(View p)
protected javax.swing.JMenu createEditMenu()
protected void updateViewTitle(View p,
javax.swing.JFrame f)
p - The view.f - The frame.public boolean isSharingToolsAmongViews()
Application
public java.awt.Component getComponent()
Application
protected javax.swing.JMenu createViewMenu(View p,
java.util.List<javax.swing.Action> viewActions)
p - The ViewviewActions - Actions for the view menu
protected javax.swing.JMenu createHelpMenu(View p)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||